package lj.courseinterect.transfer;

/**
 * Created by CatoldCui on 2015/4/20.
 */
public class OperationTransfer<T> {
    /**
     * 操作是否执行成功
     */
    private boolean isSuccess;

    /**
     * 提示消息
     */
    private String message;

    /**
     * 返回数据
     */
    private T object;

    public OperationTransfer(){
        this.isSuccess = false;
        this.message = "";
        object = null;
    }

    public OperationTransfer(boolean isSuccess){
        this.isSuccess = isSuccess;
        this.message = "";
        object = null;
    }

    public OperationTransfer(boolean isSuccess, String message){
        this.isSuccess = isSuccess;
        this.message = message;
        object = null;
    }

    public OperationTransfer(boolean isSuccess, String message, T object){
        this.isSuccess = isSuccess;
        this.message = message;
        this.object = object;
    }

    public boolean isSuccess() {
        return isSuccess;
    }

    public String getMessage() {
        return message;
    }

    public void setSuccess(boolean isSuccess) {
        this.isSuccess = isSuccess;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public T getObject() {
        return object;
    }

    public void setObject(T object) {
        this.object = object;
    }

    public String toString(){
        String obStr = object != null? object.toString() : "";
        return "OperationTransfer: isSuccess=" + isSuccess + " message=" + message + obStr;
    }
}
